package progress.exa5;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class BufferedWriterStudy {

    public static void main(String[] args) throws IOException {
        bufferedWriter();
    }

    /**
     * 缓冲字符输出流
     */
    public static void bufferedWriter() throws IOException {
       BufferedWriter bufferedWriter = null;
       try{
           bufferedWriter = new BufferedWriter(new FileWriter("四郎.txt",true));
           bufferedWriter.write("我是四郎,我爱麻子。。。。");
       }catch (Exception e) {
           e.printStackTrace();
       }finally {
           if(bufferedWriter!=null) {
               bufferedWriter.close();
           }
       }
    }
}
